package com.atao.example.lambda06;

import java.util.function.Consumer;

/**
 * @author 阿涛
 * @date 2021-03-06
 */
public class Test {

    private static void consummer(String something, Consumer<String> consumer) {
        consumer.accept(something);
    }

    private static void doubleConsummer(String something, Consumer<String> consumer1, Consumer<String> consumer2) {
        consumer1.andThen(consumer2).accept(something);
    }

    public static void main(String[] args) {
        //todo lambda表达式
        consummer("麻黄", something -> {
            System.out.println(something + "汤一碗");
        });
        //todo lambda表达式 consummer andThen
        doubleConsummer("麻黄", something -> System.out.print("华佗用" + something + "开出："),
                something -> System.out.println(something + "汤一碗"));
    }

}
